package net.model;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@Table(name = "VALOR_HISTOGRAMA")
public class ValorHistograma implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1925410515457395830L;

	@Id
	@Column(name = "uid")
	@GeneratedValue(strategy = GenerationType.AUTO)
	private Long id;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ID_HISTOGRAMA", insertable = false, updatable = false, nullable = false)
	private Histogram histograma;

	@Column(name = "valor", nullable = false)
	private Double valor;
	
	@Column(name = "indice", nullable = false)
	private Integer indice;

	public ValorHistograma() {
		super();
	}

	public ValorHistograma(Histogram histograma, Double valor) {
		super();
		this.histograma = histograma;
		this.valor = valor;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Histogram getHistograma() {
		return histograma;
	}

	public void setHistograma(Histogram histograma) {
		this.histograma = histograma;
	}

	public Double getValor() {
		return valor;
	}

	public void setValor(Double valor) {
		this.valor = valor;
	}

	public Integer getIndice() {
		return indice;
	}

	public void setIndice(Integer indice) {
		this.indice = indice;
	}
	
}